﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using System.Web.UI.HtmlControls;
using Common;

public partial class Left : System.Web.UI.Page
{
    ModuleBll moduleBll = new ModuleBll();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Process();
        }
    }
    protected void RepGroup_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            HtmlGenericControl CDiv = e.Item.FindControl("menu1") as HtmlGenericControl;
            CDiv.Attributes.Add("onclick", "showmenu('" + CDiv.ClientID + "')");

            Repeater rep = e.Item.FindControl("RepDetail") as Repeater;//找到里层的repeater对象
            ModuleData ModeRow = (ModuleData)e.Item.DataItem;//找到分类Repeater关联的数据项 
            string ModelId = ModeRow.module_id.ToString(); //获取填充子类的id 
            rep.DataSource = moduleBll.GetModuleDetail_UI(ModelId);
            rep.DataBind();
        }
    }

    private void Process()
    {
        this.RepGroup.DataSource = moduleBll.GetModuleGroup_UI();
        this.RepGroup.DataBind();
        //System.Collections.IEnumerable aa = (System.Collections.IEnumerable)moduleBll.GetModuleGroup_UI();
        //Common.PageNums.GetPageNum(aa, new DataList(), 1, moduleBll.GetModuleGroup_UI().Count);
    }
}